package com.xana.acg.mikomiko.listener;

import android.view.View;
import android.view.ViewParent;

import androidx.annotation.NonNull;
import androidx.drawerlayout.widget.DrawerLayout;

public class SelfDrawerListener implements DrawerLayout.DrawerListener {
    @Override
    public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
        DrawerLayout drawer = (DrawerLayout) drawerView.getParent();
        View view = drawer.getChildAt(0);
        int offset = (int) (drawerView.getWidth() * slideOffset);
        view.setTranslationX(-offset);
    }

    @Override
    public void onDrawerOpened(@NonNull View drawerView) {

    }

    @Override
    public void onDrawerClosed(@NonNull View drawerView) {

    }

    @Override
    public void onDrawerStateChanged(int newState) {

    }
}

